package com.example.mylibrarybase.yumengmeng07.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;

import com.example.mylibrarybase.R;
import com.example.mylibrarybase.yumengmeng07.utils.linesRadioGroup.LineRadioGroup;

import java.util.List;

/**
 * Created by 35876 于萌萌
 * 创建日期: 9:19 . 2016年10月18日
 * 描述:
 * <p>
 * <p>
 * 备注:
 */
public class TableListView_07 extends RelativeLayout {
    Context mContext;
    private View mInflate;
    private LinearLayout mActivity_list_top;
    private LinearLayout activity_list_left;
    private LinearLayout activity_list_mid;
    private LinearLayout activity_list_right;
    private LinearLayout tablayout_list_rightsum;

    public TableListView_07(Context context) {
        super(context);
        initView(context);
    }


    public TableListView_07(Context context, AttributeSet attrs) {
        super(context, attrs);
        initView(context);
    }

    public TableListView_07(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        initView(context);
    }



    private void initView(Context context) {
        mContext = context;
        LayoutInflater inflater = (LayoutInflater) context
                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        mInflate = inflater.inflate(R.layout.layou_tablayout_list_07, this);

        mActivity_list_top = (LinearLayout) mInflate.findViewById(R.id.tablayout_list_top);
        activity_list_left = (LinearLayout) mInflate.findViewById(R.id.tablayout_list_left);
        activity_list_mid = (LinearLayout) mInflate.findViewById(R.id.tablayout_list_mid);
        activity_list_right = (LinearLayout) mInflate.findViewById(R.id.tablayout_list_right);
        tablayout_list_rightsum = (LinearLayout) mInflate.findViewById(R.id.tablayout_list_rightsum);


    }

    public  void initData(int mode, List<LineRadioGroup.leftname> tList){
      LinearLayout linearLayout = null;
        //  0 左面  1 上面 2 行结算 3个数
        if (mode==0){
            linearLayout = activity_list_left;
        }else if (mode==1){
            linearLayout = mActivity_list_top;
        }else if (mode==3){
            linearLayout = activity_list_right;
        }else if (mode==2){
            linearLayout = tablayout_list_rightsum;
        }

        LineRadioGroup.updateLeftNameView(mContext,mode,tList,linearLayout);

    }
    public void initchebox(List<LineRadioGroup.FeedbackOptionItem> optionsListfinal ,LineRadioGroup.CallBackItemNum callBackItemNum){
        LineRadioGroup.updateOptionsViewcheBox(mContext,optionsListfinal,activity_list_mid,callBackItemNum);
    }

}
